//
//  CityShopkeeperHeader.m
//  PigMarket
//
//  Created by 张敬 on 2019/7/17.
//  Copyright © 2019年 pigmarket.oc. All rights reserved.
//

#define selfH 55

#import "MeaetCityFriendHeader.h"

@interface MeaetCityFriendHeader()

@property (nonatomic, strong) UIView *bottomView;


@end

@implementation MeaetCityFriendHeader

#pragma mark - lifecycle methods

- (void)setupUI{
    
    self.backgroundColor = KWhiteColor;
    
    [self addSubview:self.bottomView];

    UIBezierPath *path = [UIBezierPath bezierPathWithRect:CGRectMake(KScreenWidth/2.0-13, 10, 26, 1)];
    self.line.fillColor = mMainColor.CGColor;
    self.line.path = path.CGPath;
    self.line.hidden = NO;
}


- (void)setupLayout{
    
    self.height = selfH;

    {
        _bottomView.size = CGSizeMake(KScreenWidth, 35);
        _bottomView.mj_y = self.bottom - _bottomView.height;
        _bottomView.mj_x = 0;
    }
    
    {
        _titleLab.frame = CGRectMake(15, 0, KScreenWidth - 30, 35);
    }
    
    {
        CAShapeLayer *maskLayer = [CAShapeLayer layer];
        UIBezierPath *maskpath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, KScreenWidth, 55) byRoundingCorners:UIRectCornerTopLeft|UIRectCornerTopRight cornerRadii:CGSizeMake(8, 8)];
        maskLayer.path = maskpath.CGPath;
        self.layer.mask = maskLayer;
    }
    
}


#pragma mark - getter methods

- (UIView *)bottomView{
    
    if (!_bottomView) {
        _bottomView = [UIView new];
        _bottomView.backgroundColor = UIColorFromRGB(0xFAFAF9);
        [_bottomView addSubview:self.titleLab];
    }
    return _bottomView;
}

- (UILabel *)titleLab{
    
    if (!_titleLab) {
        _titleLab = [UILabel makeLabelWithText:@"附近掌柜" textColor:UIColorFromRGB(0x7F7F7F) font:mFont(14) textAliment:0];
       }
    return _titleLab;
}


@end
